import React from 'react';
import dynamic from 'dva/dynamic';
import { Route } from 'dva/router';

export default function memberCenterRoute(app) {



    const MemberCenter = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "memberCenterModel" */'../models/memberCenter/memberCenterModel'),
            ];
        },
        component:()=>import(/* webpackChunkName: "memberCenter" */'../routes/memberCenter/memberCenter'),
    });
    const OrderTrack = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "memberCenterModel" */'../models/memberCenter/memberCenterModel'),
            ];
        },
        component:()=>import(/* webpackChunkName: "orderTrack" */'../routes/memberCenter/orderTrack'),
    });
    const MessagesCenter = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "memberCenterModel" */'../models/memberCenter/memberCenterModel'),
            ];
        },
        component:()=>import(/* webpackChunkName: "memberCenter" */'../routes/memberCenter/messagesCenter'),
    });

    return (
        [
            <Route key="/memberCenter" exact path="/memberCenter" component={MemberCenter}/>,
            <Route key="/orderTrack" exact path="/orderTrack/:data" component={OrderTrack}/>,
            <Route key="/messagesCenter" exact path="/messagesCenter" component={MessagesCenter}/>,
        ]
    );
}
